package cn.slipi.pan;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.Solon;
import org.noear.solon.Utils;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.web.cors.CrossFilter;

@Slf4j
@SolonMain
public class PanApplication {

    public static void main(String[] args) {
        Solon.start(PanApplication.class, args, app -> {
            // 跨域支持。加-1 优先级更高
            app.filter(-1, new CrossFilter().allowedOrigins("*"));
            String loglevel = System.getenv("LOG_LEVEL");
            if (Utils.isNotEmpty(loglevel)) {
                app.cfg().put("solon.logging.logger.root.level", loglevel);
            }
            log.info("PAN: {}", app.cfg().get("solon.app.version"));
        });
    }

}
